// eslint-disable-next-line no-unused-vars
import { useState } from 'react';
import styles from './List.module.scss';
import { useSearchParams } from 'react-router-dom';
import QuestionCard from '../../components/QuestionCard';
import ListSearch from '../../components/ListSearch';
import { Typography } from 'antd';
import { useTitle } from 'ahooks';
const { Title } = Typography;
const List = () => {
	useTitle('列表✌️');
	const [question, setQuestion] = useState([
		{
			_id: 'q1',
			title: '问卷1',
			isPublished: false,
			isStart: false,
			answerCount: 3,
			createdAt: '2025-11-09 23:53:32',
		},
		{
			_id: 'q2',
			title: '问卷2',
			isPublished: true,
			isStart: true,
			answerCount: 3,
			createdAt: '2025-11-10 23:53:32',
		},
		{
			_id: 'q3',
			title: '问卷3',
			isPublished: false,
			isStart: true,
			answerCount: 3,
			createdAt: '2025-11-11 23:53:32',
		},
	]);
	const [searchParams] = useSearchParams('keyword');
	console.log(searchParams.get('keyword'));

	return (
		<>
			<div className={styles.header}>
				<Title level={3}>我的问卷</Title>
				<div className={styles.right}>
					<ListSearch />
				</div>
			</div>
			<div className={styles.content}>
				{question.map(item => {
					return <QuestionCard key={item._id} {...item} />;
				})}
			</div>
			<div className={styles.footer}>下拉加载更多</div>
		</>
	);
};

export default List;
